<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/Rooms.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from '@/extension/mall/Rooms.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '房型管理',
        name: 'Rooms',
        url: '/Rooms/',
        sortName: 'createDate',
      },
      extend: extend,
      editFormFields: {
        room_Name: '',
        room_Code: '',
        pms_Room_Code: '',
        real_Quantity: '',
        room_Introduction: '',
        people_Number: '',
        oldestChild: '',
        room_picture: [],
        imageAddress: [],
        room_direction: '',
        room_area: '',
        isAvailable: '',
        Facilities_and_Features: [],
        id: '',
        createDate: '',
        createID: '',
        creator: '',
        modifyDate: '',
        modifier: '',
        modifyID: '',
        typeName: '',
        typeCode: '',
        latitude: '',
      },
      editFormOptions: [
        [
          { title: '房型名称', required: true, field: 'room_Name', colSize: 6, type: 'text' },
          { title: '房型编码', required: true, field: 'room_Code', colSize: 6, type: 'text' },
        ],
        [{ title: '实际数量', required: true, field: 'real_Quantity', colSize: 6, type: 'number' }],
        [
          { dataKey: 'room_Introduction', data: [], title: '房型介绍', required: true, field: 'room_Introduction', colSize: 6, type: 'select' },
          { title: '最多可住人数', field: 'people_Number', colSize: 6, type: 'number' },
        ],
        [{ title: '最多携带儿童数', field: 'oldestChild', colSize: 6, type: 'number' }],
        [{ title: '头图', field: 'room_picture', colSize: 4, type: 'imgupgrade' }],
        [{ title: '轮播图', required: false, field: 'imageAddress', colSize: 12, type: 'imgupgrade' }],
        [
          { title: '房间朝向', required: true, field: 'room_direction', colSize: 4, type: 'text' },
          { title: '房间面积', required: true, field: 'room_area', colSize: 4, type: 'decimal' },
          { title: '是否可用', required: true, field: 'isAvailable', colSize: 4, type: 'switch' },
        ],
        [
          {
            title: '设施与功能( 1 无烟房 2 WiFi 3 电话 4 迷你吧 5 送餐)',
            required: true,
            field: 'Facilities_and_Features',
            colSize: 12,
            type: 'text',
          },
        ],
        [
          { title: '主键', required: true, field: 'id', disabled: true, type: 'number' },
          { title: '创建时间', field: 'createDate' },
          { title: '创建人ID', field: 'createID', type: 'number' },
          { title: '创建人', field: 'creator' },
          { title: '修改时间', field: 'modifyDate' },
          { title: '修改人', field: 'modifier' },
          { title: '修改人ID', field: 'modifyID', type: 'number' },
          { title: '产品类型名称', field: 'typeName' },
          { title: '产品类型编码', field: 'typeCode' },
          { title: '经纬度', field: 'latitude' },
        ],
      ],
      searchFormFields: { room_Name: '', room_Code: '', pms_Room_Code: '', room_Introduction: '', room_direction: '', room_area: '' },
      searchFormOptions: [
        [
          { title: '房型名称', field: 'room_Name', type: 'like' },
          { title: '房型编码', field: 'room_Code', type: 'like' },
          { title: 'pms房型代码', field: 'pms_Room_Code', type: 'like' },
        ],
        [
          { dataKey: 'room_Introduction', data: [], title: '房型介绍', field: 'room_Introduction', type: 'select' },
          { title: '房间朝向', field: 'room_direction', type: 'like' },
          { title: '房间面积', field: 'room_area', type: 'decimal' },
        ],
      ],
      columns: [
        { field: 'id', title: '主键', type: 'int', width: 90, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'room_Name', title: '房型名称', type: 'string', width: 120, require: true, align: 'left', sortable: true },
        { field: 'room_Code', title: '房型编码', type: 'string', width: 120, require: true, align: 'left' },

        { field: 'real_Quantity', title: '实际数量', type: 'int', width: 90, require: true, align: 'left' },
        {
          field: 'room_Introduction',
          title: '房型介绍',
          type: 'string',
          bind: { key: 'room_Introduction', data: [] },
          width: 120,
          require: true,
          align: 'left',
        },
        { field: 'imageAddress', title: '轮播图', type: 'imgupgrade', width: 200, require: false, align: 'left' },
        { field: 'room_direction', title: '房间朝向', type: 'string', width: 90, require: true, align: 'left' },
        { field: 'room_area', title: '房间面积', type: 'decimal', width: 90, require: true, align: 'left' },
        {
          field: 'Facilities_and_Features',
          title: '设施与功能( 1 无烟房 2 WiFi 3 电话 4 迷你吧 5 送餐)',
          type: 'string',
          width: 200,
          hidden: true,
          require: true,
          align: 'left',
        },
        { field: 'createDate', title: '创建时间', type: 'datetime', width: 150, align: 'left', sortable: true },
        { field: 'createID', title: '创建人ID', type: 'int', width: 90, hidden: true, align: 'left' },
        { field: 'creator', title: '创建人', type: 'string', width: 120, align: 'left' },
        { field: 'modifyDate', title: '修改时间', type: 'datetime', width: 150, align: 'left', sortable: true },
        { field: 'modifier', title: '修改人', type: 'string', width: 120, align: 'left' },
        { field: 'modifyID', title: '修改人ID', type: 'int', width: 90, hidden: true, align: 'left' },
        { field: 'typeName', title: '产品类型名称', type: 'string', width: 150, hidden: true, align: 'left' },
        { field: 'typeCode', title: '产品类型编码', type: 'string', width: 150, hidden: true, align: 'left' },
        { field: 'isAvailable', title: '是否可用', type: 'sbyte', width: 90, require: true, align: 'left' },
        { field: 'room_picture', title: '头图', type: 'imgupgrade', width: 90, align: 'left' },
        { field: 'latitude', title: '经纬度', type: 'string', width: 220, hidden: true, align: 'left' },
        { field: 'remark', title: '备注', type: 'string', width: 220, hidden: true, align: 'left' },
        { field: 'people_Number', title: '房间最多可住人数', type: 'int', width: 90, hidden: true, align: 'left' },
        { field: 'oldestChild', title: '最多携带儿童数', type: 'int', width: 90, hidden: true, align: 'left' },
      ],
      detail: {
        cnName: '#detailCnName',
        columns: [],
        sortName: '',
        key: '',
      },
    }
  },
}
export default vueParam
</script>
